﻿using Architecture.Domian.Common;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Architecture.Domain.TraceabilityManage
{
    /// <summary>
    /// 养殖表
    /// </summary>
    [Table("Culture")]
    public class Culture : AuditInfo
    {
        /// <summary>
        /// 养殖Id
        /// </summary>
        [Key]
        public int CId { get; set; }

        /// <summary>
        /// 生产批次
        /// </summary>
        [StringLength(50)]
        public string? ProductionLot { get; set; }

        /// <summary>
        /// 养殖场Id(公司Id)
        /// </summary>
        public int FarmId { get; set; }

        /// <summary>
        /// 动检证
        /// </summary>
        [StringLength(1000)]
        public string? DynamicVerification { get; set; }

        /// <summary>
        /// 品种
        /// </summary>
        [StringLength(50)]
        public string? Breed { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        [StringLength(50)]
        public string? Source { get; set; }

        /// <summary>
        /// 饲养天数
        /// </summary>
        public int FeedingDays { get; set; }

        /// <summary>
        /// 品牌
        /// </summary>
        [StringLength(50)]
        public string? Brand { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [StringLength(50)]
        public string? PersonIncharge { get; set; }

        /// <summary>
        /// 出栏日期
        /// </summary>
        public DateTime? PublicationDate { get; set; }

        /// <summary>
        /// 出栏日期
        /// </summary>
        [NotMapped]
        public string? PublicationDateTime
        {
            get { return PublicationDate == null ? null : Convert.ToDateTime(PublicationDate).ToString("yyyy年MM月dd日"); }
        }
    }
}
